#include<iostream>
using namespace std;
#include<vector>


void printvector(vector<int>&v1) {

	for (vector<int>::iterator it = v1.begin(); it != v1.end(); it++) {
		cout << *it << " ";
	}
	cout<<endl;

}


void test01() {
	vector<int>v1;
	for (int i = 0; i < 10; i++) {
		v1.push_back(i);
	}
	printvector(v1);



	cout << v1[2] << endl;
	cout << v1.at(2) << endl;
	cout << v1.front() << endl;
	cout << v1.back() << endl;

	vector<int>v2=v1;
	printvector(v2);
	vector<int>v3;
	v3.assign(v1.begin(), v1.end());
	printvector(v3);

	if (v1.empty()) {
		cout << "kong" << endl;


	}
	else {
		cout << v1.capacity() << endl;
		cout << v1.size() << endl;
	}








	v1.resize(15,2);
	printvector(v1);
	v1.resize(2);
	printvector(v1);
}
int main() {

	test01();
	system("pause");
	return 0;
}